package cn.lngaosu.lwyd.module.integration.dal.mysql.weixinvideoliverecord;

import java.util.*;

import cn.lngaosu.lwyd.framework.common.pojo.PageResult;
import cn.lngaosu.lwyd.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.lngaosu.lwyd.framework.mybatis.core.mapper.BaseMapperX;
import cn.lngaosu.lwyd.module.integration.dal.dataobject.weixinvideoliverecord.WeixinvideoLiverecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.lngaosu.lwyd.module.integration.controller.admin.weixinvideoliverecord.vo.*;

/**
 * 微信视频号直播记录 Mapper
 *
 * @author 张恒
 */
@Mapper
public interface WeixinvideoLiverecordMapper extends BaseMapperX<WeixinvideoLiverecordDO> {

    default PageResult<WeixinvideoLiverecordDO> selectPage(WeixinvideoLiverecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WeixinvideoLiverecordDO>()
                .betweenIfPresent(WeixinvideoLiverecordDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(WeixinvideoLiverecordDO::getExportId, reqVO.getExportId())
                .eqIfPresent(WeixinvideoLiverecordDO::getDescription, reqVO.getDescription())
                .eqIfPresent(WeixinvideoLiverecordDO::getCoverUrl, reqVO.getCoverUrl())
                .likeIfPresent(WeixinvideoLiverecordDO::getNickname, reqVO.getNickname())
                .eqIfPresent(WeixinvideoLiverecordDO::getHeadUrl, reqVO.getHeadUrl())
                .orderByDesc(WeixinvideoLiverecordDO::getId));
    }

}